<?php

class VendorController extends BaseController {
	
	// Table Name
	public $table = 'vendor';

	// Model Class
	public $model = 'Vendor';

	// Action before store
	public function preStore($data) {
		$this->rules = array(
				'name' => 'required'
			);
		return $data;
	}

	// Set List Data
	public function setListData($data, $object) {
		if(isset($data['filter_id'])) {
			$object = $object->where('id', '=', $data['filter_id']);
		}
		return $object;
	}

	// Add List Data
	public function addListData($data) {
		$data['test'] = '123';
		return $data;
	}

	// Use to add data on Form
	public function addFormData($data, $id=null) {
		$data['test']  = '123';
		return $data;
	}

}